package dfbz.匿名对象和匿名内部类;

public class Test01 {
    public static void main(String[] args) {
        //创建线程的第一种方式
//        Mythread mythread = new Mythread();
//        mythread.start();
  /*      new Thread(){
            @Override
            public void run() {
                System.out.println(Thread.currentThread().getName());
            }
        }.start();
    }*/
        //创建线程的第二种方式
     /*   new Thread(new Runnable() {
            @Override
            public void run() {
                System.out.println(Thread.currentThread().getName());
            }
        }, "mike").start();
    }*/
        new Thread(() -> System.out.println(Thread.currentThread().getName()),"mike").start(); }  //new Thread(new Rannable(){})
}
